package com.jieyun.rbac.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jieyun.core.utils.ServerResponse;
import com.jieyun.rbac.service.SysRoleAclService;

/**
 * 角色权限controler
 * @author trekxu
 *
 */
@Controller
@RequestMapping("sys/roleAcl")
public class SysRoleAclController {
	
	@Resource
	private SysRoleAclService sysRoleAclService;
	
	
	/**
	 * 角色对应的权限
	 * @param id
	 * @return
	 */
	@RequestMapping("list")
	@ResponseBody
	public ServerResponse roleAcl(Integer id) {
		return this.sysRoleAclService.roleAcl(id);
	}
	
	/**
	 * 为角色分配权限
	 * @return
	 */
	@ResponseBody
	@RequestMapping("allocate")
	public ServerResponse allocate(Integer roleId , String[] aclIds) {
		return this.sysRoleAclService.allocate(roleId,aclIds);
	}
}
